<<template>
    <div style="height:100%;">
        <!--表5蔬菜生产经营实体表T_VegProsecution-->
        <Row>
            <Col span="24" class="col-margin"> 县(市)：
            <Cascader :data="AreaList" change-on-select @on-change='SearchCascaderChange' style="width: 200px;float: left;margin-right: 5px;"></Cascader>
            <!--根据需求删除不不要查询条件-->
            填报年度：
            <Select v-model="searchModel.FillInYear" placeholder="全部" style="width: 100px" @on-change="getPageData()">
                <Option value="">全部</Option>
                <Option :value="item.DictValue" v-for="item in CreateYearList" :key="item.DictValue">{{item.DictText}}</Option>
            </Select>
            时间周期：
            <Select v-model="searchModel.TimesType" placeholder="全部" style="width: 100px" @on-change="getPageData()">
                <Option value="">全部</Option>
                <Option :value="item.DictValue" v-for="item in CycleList" :key="item.DictValue">{{item.DictText}}</Option>
            </Select>
            <Button icon="ios-search" type="ghost" @click="getPageData()">查询</Button>
            </Col>
        </Row>
        <Row>
            <Col span="24" class="col-margin">
            <Table size="small" @on-select="selectSingel" @on-select-all="selectAll" :height="clientHeight" border :context="ctx" :columns="columnsList" :data="datas.rows" no-data-text='暂无数据...'></Table>
            </Col>
        </Row>
        <Row>
            <Col span="24">
            <Page class="page-style" :total="datas.total" placement="top" @on-change="getPageNumber" :page-size="searchModel.PageSize" :page-size-opts='pageSizeOpts' show-sizer @on-page-size-change="getPageSize" show-total show-elevator></Page>
            </Col>
        </Row>
        <Modal v-model="showType" :mask-closable="false" width="1200">
            <p slot="header" class="title">
                <Icon type="ios-paper" size="20"></Icon>
                <span style="font-size: 20px">生产经营实体情况</span>
            </p>
            <p slot="close">
                <Icon type="close-circled" color="red" size=25></Icon>
            </p>
            <table class="reptable">
                <caption style="font-size: 24px;">水果生产经营实体情况(全面统计)</caption>
                <tr style="text-align:center">
                    <td  colspan="4" width="200px">类型</td>
                    <td width="50px">单位</td>
                    <td >数量</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">一.水果企业</td>
                    <th>个</th>
                    <th>{{dataModel.VegCompanyNum}}</th>
                </tr>
                <tr>
                    <td rowspan="14">水果企业</td>
                    <td min-width="30px" colspan="3">种植企业</td>
                    <td>个</td>
                    <td>{{convertNum(dataModel.zzNum_pro+dataModel.zzNum_city+dataModel.zzNum_singel)}}</td>
                </tr>
                <tr>
                    <td rowspan="3" width="40px" style="border-right:none;"></td>
                    <td rowspan="3" width="100px" style="border-left:none;">其中</td>
                    <td >省级及以上龙头企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_pro}}</td>
                </tr>
                <tr>  
                    <td>州县（市）级龙头企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_city}}</td>
                </tr>
                <tr>
                    <td>个体工商户</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td rowspan="6" width="40px" style="border-right:none;"></td>
                    <td rowspan="6" width="100px" style="border-left:none;">营业额</td>
                    <td>1000万元以下</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>  
                    <td>1000～5000万元</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>5000～10000万元</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>1亿元以上</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td>5亿元以上</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td>10亿元以上</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td colspan="3">从事水果产品加工的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td colspan="3">从事水果营销的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td rowspan="2" width="40px" style="border-right:none;"></td>
                    <td rowspan="2" width="100px" style="border-left:none;">其中</td>
                    <td>水果外贸的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>  
                    <td>开展电子商务的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">二.水果生产合作组织</th>
                    <th>个</th>
                    <th>{{dataModel.zzNum_singel}}</th>
                </tr>
                <tr>
                    <td rowspan="3">水果生产合作组织</td>
                    <td rowspan="3" style="border-right:none;"></td>
                    <td rowspan="3" width="10px" style="border-left:none;">其中</td>
                    <td>1.水果专业合作组织数量</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>2.参加农民合作组织农户数</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>3.农民专业合作组织种植面积</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">三.从事水果种植的农户数</td>
                    <th>个</th>
                    <th>{{dataModel.zzNum_singel}}</th>
                </tr>
                <tr>
                    <td  rowspan="4">从事水果种植的农户数</td>
                    <td  colspan="3">种植大户</td>
                    <td>户</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td rowspan="3" style="border-right:none;"></td>
                    <td rowspan="3" style="border-left:none;">其中</td>
                    <td>1.100亩以下</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>2.100亩-500亩</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>3.500亩以上</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">四.育苗基地</th>
                    <th>个</th>
                    <th>{{dataModel.zzNum_singel}}</th>
                </tr>
                <tr>
                    <td  rowspan="2">育苗基地</td>
                    <td  colspan="3">育苗基地数量</td>
                    <td>户</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">育苗数量</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th width="40px" min-width="30px" colspan="4" style="text-align:left;">五.相关质量标准认证情况</th>
                    <th></th>
                    <th></th>
                </tr>
                <tr>
                    <td width="50px" rowspan="12">相关质量标准认证情况</td>
                    <td width="40px" min-width="30px" colspan="3">1.国家级农业标准化示范县数量</td>
                    <td>户</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">2.出口食品农产品质量安全示范区数量</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">3.注册商标数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">4.出口基地备案面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">5.GAP认证面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">6.GAP认证产品数量</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">7.无公害农产品数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">8.无公害农产品认证面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">9.绿色产品数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">10.绿色产品认证面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">11.地理标志证明商标数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">12.地理标志产品保护认证数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
            </table>
            <div slot="footer">
                <div style="text-align:right;padding-top:5px">
                    <Button type="primary" @click="saveSure()">审核通过</Button>
                    <Button type="warning" @click="savenUnSure()">审核不通过</Button>
                </div>
                <Alert style="margin-top:5px;text-align:left" banner type="error">
                    填报说明: 1.全省范围内从乡（镇）推广站起，逐级全面统计，由州（市）汇总后上报。
                    <span slot="desc">
                    </span>
                </Alert>
            </div>
        </Modal>
        <Modal v-model="showAudit" :mask-closable="false" width="500">
            <p slot="header" class="title">
                <Icon type="ios-paper" size="20"></Icon>
                <span style="font-size: 20px">审核不通过原因</span>
            </p>
            <p slot="close">
                <Icon type="close-circled" color="red" size=25></Icon>
            </p>
            <Input type="textarea" :rows="4" v-model="strMsg" placeholder="请输入不通过原因..."></Input>
            <div slot="footer">
                <Button type="primary" @click="sureUnSure()">确定</Button>
                <Button type="ghost" @click="cancelUnSure()" style="margin-left: 8px">取消</Button>
            </div>
        </Modal>
        <Modal v-model="ViewShow" :mask-closable="false" width="800">
            <p slot="header" class="title">
                <Icon type="ios-paper" size="20"></Icon>
                <span style="font-size: 20px">生产经营实体情况</span>
            </p>
            <p slot="close">
                <Icon type="close-circled" color="red" size=25></Icon>
            </p>
            <table class="reptable">
                <caption style="font-size: 24px;">水果生产经营实体情况(全面统计)</caption>
                <tr style="text-align:center">
                    <td  colspan="4" width="200px">类型</td>
                    <td width="50px">单位</td>
                    <td >数量</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">一.水果企业</td>
                    <th>个</th>
                    <th>{{dataModel.VegCompanyNum}}</th>
                </tr>
                <tr>
                    <td rowspan="14">水果企业</td>
                    <td min-width="30px" colspan="3">种植企业</td>
                    <td>个</td>
                    <td>{{convertNum(dataModel.zzNum_pro+dataModel.zzNum_city+dataModel.zzNum_singel)}}</td>
                </tr>
                <tr>
                    <td rowspan="3" width="40px" style="border-right:none;"></td>
                    <td rowspan="3" width="100px" style="border-left:none;">其中</td>
                    <td >省级及以上龙头企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_pro}}</td>
                </tr>
                <tr>  
                    <td>州县（市）级龙头企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_city}}</td>
                </tr>
                <tr>
                    <td>个体工商户</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td rowspan="6" width="40px" style="border-right:none;"></td>
                    <td rowspan="6" width="100px" style="border-left:none;">营业额</td>
                    <td>1000万元以下</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>  
                    <td>1000～5000万元</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>5000～10000万元</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>1亿元以上</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td>5亿元以上</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td>10亿元以上</span></td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td colspan="3">从事水果产品加工的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td colspan="3">从事水果营销的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td rowspan="2" width="40px" style="border-right:none;"></td>
                    <td rowspan="2" width="100px" style="border-left:none;">其中</td>
                    <td>水果外贸的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>  
                    <td>开展电子商务的企业</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">二.水果生产合作组织</th>
                    <th>个</th>
                    <th>{{dataModel.zzNum_singel}}</th>
                </tr>
                <tr>
                    <td rowspan="3">水果生产合作组织</td>
                    <td rowspan="3" style="border-right:none;"></td>
                    <td rowspan="3" width="10px" style="border-left:none;">其中</td>
                    <td>1.水果专业合作组织数量</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>2.参加农民合作组织农户数</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>3.农民专业合作组织种植面积</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">三.从事水果种植的农户数</td>
                    <th>个</th>
                    <th>{{dataModel.zzNum_singel}}</th>
                </tr>
                <tr>
                    <td  rowspan="4">从事水果种植的农户数</td>
                    <td  colspan="3">种植大户</td>
                    <td>户</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td rowspan="3" style="border-right:none;"></td>
                    <td rowspan="3" style="border-left:none;">其中</td>
                    <td>1.100亩以下</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>2.100亩-500亩</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td>3.500亩以上</td>
                    <td>个</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th colspan="4" style="text-align:left;">四.育苗基地</th>
                    <th>个</th>
                    <th>{{dataModel.zzNum_singel}}</th>
                </tr>
                <tr>
                    <td  rowspan="2">育苗基地</td>
                    <td  colspan="3">育苗基地数量</td>
                    <td>户</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">育苗数量</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <th width="40px" min-width="30px" colspan="4" style="text-align:left;">五.相关质量标准认证情况</th>
                    <th></th>
                    <th></th>
                </tr>
                <tr>
                    <td width="50px" rowspan="12">相关质量标准认证情况</td>
                    <td width="40px" min-width="30px" colspan="3">1.国家级农业标准化示范县数量</td>
                    <td>户</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">2.出口食品农产品质量安全示范区数量</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">3.注册商标数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
                <tr>
                    <td width="40px" min-width="30px" colspan="3">4.出口基地备案面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">5.GAP认证面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">6.GAP认证产品数量</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">7.无公害农产品数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">8.无公害农产品认证面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">9.绿色产品数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">10.绿色产品认证面积</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">11.地理标志证明商标数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr><tr>
                    <td width="40px" min-width="30px" colspan="3">12.地理标志产品保护认证数</td>
                    <td>万株</td>
                    <td>{{dataModel.zzNum_singel}}</td>
                </tr>
            </table>
            <div slot="footer">
                <Alert style="margin-top:5px;text-align:left" banner type="error">
                    填报说明: 1.全省范围内从乡（镇）推广站起，逐级全面统计，由州（市）汇总后上报。
                    <span slot="desc">
                    </span>
                </Alert>
            </div>
        </Modal>
    </div>
</template>
<script>
export default {
    data() {
        return {
            ViewShow: false,//查看状态
            Id: '',
            showAudit: false,
            strMsg: '',
            userInfo: this.GetlocaStorage("fruuserinfo"),
            AreaList: [],//所属行政区划数组,
            TableCodeList: this.GetGroupDict("ReportTableName"),//表名称
            CreateYearList: this.GetGroupDict("ReportYear"),//周期
            CycleList: this.GetGroupDict("ReportCycle"),//
            TabTitleList: [],//tab选项卡列表
            selectTabName: '',
            showType: false,//编辑框弹出状态
            ruleValidate: {//验证模型
                TableName: [{ required: true, message: '报表名称不能为空', trigger: 'blur' }],
                TableCode: [{ required: true, message: '报表代码不能为空', trigger: 'blur' }],
                CreateYear: [{ required: true, message: '年度不能为空', trigger: 'blur' }],
                Cycle: [{ required: true, message: '时间周期不能为空', trigger: 'blur' }],
                CreateTime: [{ required: true, message: '生成时间不能为空', trigger: 'blur' }],
            },
            dataModel: {//编辑模型
                Id: 0,
                ReportId: '',
                VegCompanyNum: '',
                zzNum_pro: '',
                zzNum_city: '',
                zzNum_singel: '',
                zzNum_yye1: '',
                zzNum_yye2: '',
                zzNum_yye3: '',
                zzNum_yye4: '',
                zzNum_yye5: '',
                zzNum_yye6: '',
                SgjgNum: '',
                SgyxNum: '',
                SgwmNum: '',
                nmzyhzNum: '',
                sgzzNhNum: '',
                ZZDHNum: '',
                ZZDHOne: '',
                ZZDHTwo: '',
                ZZDHThree: '',
                ymjdNum: '',
                ymNum: '',
                DzswNum: '',
                HzNum: '',
                zyhzNum: '',
                nhhzNum: '',
                zlrzNum_sfx: '',
                zlrzNum_sfq: '',
                zlrzNum_sbs: '',
                zlrzNum_bamj: '',
                zlrzNum_rzmj: '',
                zlrzNum_rzsl: '',
                zlrzNum_wghmj: '',
                zlrzNum_bluecp: '',
                zlrzNum_bluecpmj: '',
                zlrzNum_dlsb: '',
                zlrzNum_dlbh: '',
                zlrzNum_wghNum: '',
            },
            //查询模型：根据需求删除不不要查询条件
            searchModel: {
                ReportCode: 'FruProsecution',
                FillInYear: '',
                TimesType: '',
                AreaCode: '',
                PageNumber: 1, PageSize: 20
            },
            pageSizeOpts: [20, 40, 50],//默认分页最大设置
            datas: {},//table数据对象
            dataIds: [],
            ctx: this,//table数据上下文
            columnsList: [//表头对象
                { title: "报表名称", key: "ReportName" },
                { title: "填报年度", key: "FillInYear", width: 90 },
                { title: "属行政区划", key: "AreaCodeName", width: 220 },
                { title: "填报周期", key: "TimesCycle", width: 90 },
                {
                    title: "报表状态", key: "StatusName", width: 100, render: (h, params) => {
                        switch (params.row.Status * 1) {
                            case 0:
                                return h('span', { style: { color: '#ed3f14' } }, params.row.StatusName);
                            case 1:
                                return h('span', { style: { color: '#ff9900' } }, params.row.StatusName);
                            case 2:
                                return h('span', { style: { color: '#993300' } }, params.row.StatusName);
                            case 3:
                                return h('span', { style: { color: '#2d8cf0' } }, params.row.StatusName);
                            case 4:
                                return h('span', { style: { color: '#19be6b' } }, params.row.StatusName);
                            case 5:
                                return h('span', { style: { color: '#80848f' } }, params.row.StatusName);
                            default:
                                return h('span', { style: { color: '#ff9900' } }, params.row.StatusName);
                        }
                    }
                },
                { title: "填报时间", key: "StrUpdateTime", width: 160 },
                {
                    title: "操作", key: "Id", width: 250, align: 'center',
                    render: (h, params) => {
                        return h('div', [
                            h('Button', {
                                class: {
                                    ieditColor: true
                                },
                                props: {
                                    size: 'small',
                                    type: 'ghost',
                                    icon: 'ios-paper-outline'
                                }, style: {
                                    marginRight: '5px'
                                }, on: {
                                    click: () => {
                                        this.showInfo(params.row.Id, params.row.ReportCode)
                                    }
                                }
                            }, '查看'),
                            h('Button', {
                                class: {
                                    ieditColor: true
                                },
                                props: {
                                    size: 'small',
                                    type: 'ghost',
                                    icon: 'network'
                                }, style: {
                                    marginRight: '5px'
                                }, on: {
                                    click: () => {
                                        this.editInfo(params.row.Id, params.row.ReportCode)
                                    }
                                },
                                attrs: {
                                    disabled: params.row.Status == 4 ? true : false
                                }
                            }, '审核'),
                            h('Button', {
                                class: {
                                    ieditColor: true
                                },
                                props: {
                                    size: 'small',
                                    type: 'ghost',
                                    icon: 'ios-undo'
                                },
                                style: {
                                    marginRight: '5px'
                                },
                                on: {
                                    click: () => {
                                        this.unReview(params.row.Id, params.row.ReportCode)
                                    }
                                },
                                directives: [
                                    {
                                        name: 'omg-operation',
                                        value: { op: "unreview" }
                                    }
                                ],
                            }, '取消审核'),
                        ]);
                    }
                }],
            clientHeight: window.innerHeight - 220,//表格默认高度
        }
    },
    mounted() {
        //table高度计算方法
        const that = this;
        window.onresize = () => {
            return (() => {
                that.clientHeight = window.innerHeight - 220;
            })()
        };
    },
    methods: {
        convertNum: function (num) { //小数点处理
            if (isNaN(num)) {
                return '0';
            }
            return Number(num).toFixed(2);
        },
        //初始化行政区划树
        SearchAreaList() {
            var areaCode = this.userInfo.AreaCode;
            if (areaCode != '530000000000') {
                var item = this.GetlocaStorage("areatreelist")[0];
                for (var i = 0; i < item.children.length; i++) {
                    if (item.children[i].value == areaCode) {
                        this.AreaList.push(item.children[i]);
                    }
                }
            } else {
                this.AreaList = this.GetlocaStorage("areatreelist");
            }
        },
        //查询行政区划级联选择
        SearchCascaderChange(value, selectedData) {
            const index = value.length - 1;
            this.searchModel.AreaCode = value[index];
        },
        getTab(name) {
            //console.log(name);
            this.selectTabName = name;
        },
        //查看报表
        showInfo(id, reportCode) {
            var self = this;
            this.$http.get("Report", { params: { id: id, reportCode: reportCode } }).then(//获取数据编辑项的值
                function (res) {
                    switch (res.data.list.status) {
                        case 1:
                            self.dataModel = res.data.list.model;
                            self.ViewShow = true;
                            break;
                        case 0:
                            self.$Modal.error({ title: "提示信息", content: "编辑数据加载失败!!!" });
                            break;
                        case -1:
                            self.$Modal.error({ title: "提示信息", content: "编辑数据加载失败!!!" });
                            break;
                    }
                }
            );
        },
        //获取当前页码
        getPageNumber(pageIndex) {
            this.searchModel.PageNumber = pageIndex;
            this.initPageData();
        },
        //获取当前分页大小
        getPageSize(pageSize) {
            this.searchModel.PageSize = pageSize;
            this.initPageData();
        },
        initPageData() {
            var areaCode = this.userInfo.AreaCode;
            this.searchModel.AreaCode = areaCode;
            this.getPageData();
        },
        //获取this.datas: {},//table数据对象
        getPageData() {
            var self = this;
            self.$http.post('Report/PostReviewPageList', this.searchModel).then(function (res) {
                if (res.data.status === 1) {
                    self.datas = res.data;
                }
                else {
                    self.$Modal.error({ title: '提示信息', content: res.data.message });
                }
            });
        },
        //编辑获取对象传入id
        editInfo(id, reportCode) {//编辑
            var self = this;
            this.Id = id;
            this.$http.get("Report", { params: { id: id, reportCode: reportCode } }).then(//获取数据编辑项的值
                function (res) {
                    switch (res.data.list.status) {
                        case 1:
                            self.dataModel = res.data.list.model;
                            self.modalShow();
                            break;
                        case 0:
                            self.$Modal.error({ title: "提示信息", content: "编辑数据加载失败!!!" });
                            break;
                        case -1:
                            self.$Modal.error({ title: "提示信息", content: "编辑数据加载失败!!!" });
                            break;
                    }
                }
            );
        },
        initTab(self, datas) {
            self.TabTitleList = [];
            for (var i = 0; i < datas.length; i++) {
                if (!self.checkTab(datas[i].SortCode, self)) {
                    var item = new Object();
                    item.SortCode = datas[i].SortCode;
                    item.SortName = datas[i].SortName;
                    item.list = [];
                    for (var j = 0; j < datas.length; j++) {
                        if (datas[j].SortCode == datas[i].SortCode) {
                            if (!self.checkItem(item.list, datas[j].ItemCode)) {
                                item.list.push(datas[j]);
                            }
                        }
                    }
                    self.TabTitleList.push(item);
                }
            }
            return self.TabTitleList;
        },
        checkTab(SortCode, self) {
            var res = false;
            for (var i = 0; i < self.TabTitleList.length; i++) {
                if (self.TabTitleList[i].SortCode == SortCode) {
                    res = true;
                }
            }
            return res;
        },
        checkItem(datas, ItemCode) {
            var res = false;
            for (var i = 0; i < datas.length; i++) {
                if (datas[i].ItemCode == ItemCode) {
                    res = true;
                }
            }
            return res;
        },
        //删除对象
        delInfo(id) {
            var self = this;
            self.$Modal.confirm({
                title: '提示信息',
                content: '<p>数据删除后不可恢复，确定要删除？</p>',
                onOk: () => {
                    this.$http.delete("GenerateLog", { params: { id: id } }).then(
                        function (res) {
                            if (res.data.status == 1) {
                                self.$Notice.success({ title: '删除成功！', desc: false });
                                self.initPageData();
                            }
                            else {
                                self.$Modal.error({ title: "提示信息", content: "数据删除失败!!!" });
                            }
                        }
                    );
                }
            });
        },
        //省级取消审核
        unReview(id, reportCode) {
            var model = new Object();
            model.Id = id;
            model.reportType = '0';
            model.strMsg = '省级已取消审核!';
            this.save(model);
        },
        //审核
        save(model) {
            var self = this;
            this.$http.post("Report/PostUpStatus", model).then(
                function (res) {
                    if (res.data.status == 1) {
                        self.$Notice.success({ title: '审核完成!', desc: false });
                        self.getPageData();
                        self.strMsg = '';
                        self.modalHide();
                    }
                    else {
                        self.$Modal.error({ title: "提示信息", content: "数据审核失败!!!" });
                    }
                });
        },
        saveSure() {
            var model = new Object();
            model.Id = this.Id;
            model.reportType = '4';
            model.strMsg = '';
            this.save(model);
            this.modalHide();
        },
        //审核未通过
        savenUnSure() {
            var self = this;
            this.showAudit = true;
        },
        sureUnSure() {
            this.showAudit = false;
            var model = new Object();
            model.Id = this.Id;
            model.reportType = '0';
            model.strMsg = this.strMsg;
            this.save(model);
        },
        cancelUnSure() {
            this.showAudit = false;
            //this.modalHide();
            this.strMsg = '';
        },
        //编辑框打开
        modalShow() {
            this.showType = true;
        },
        //编辑框关闭
        modalHide() {
            this.showType = false;
        },
        //取消方法
        cancel() {
            this.showType = false;//关闭modal
            this.TabTitleList = [];
        },
        //重置model
        restModel(modelname) {
            this.$refs[modelname].resetFields();//重置model
        },
        //全选方法
        selectAll(selection) {
            this.dataIds = selection;
        },
        //checkbox选中方法
        selectSingel(selection, row) {
            this.dataIds = selection;
        },
        //checkbox取消选中方法
        selecChange(selection) {
            this.dataIds = selection;
        },
        //批量删除
        multiSelect() {
            var self = this;
            if (this.dataIds.length !== 0) {
                self.$Modal.confirm({
                    title: '提示信息',
                    content: '<p>数据删除后不可恢复，确定要删除？</p>',
                    onOk: () => {
                        var ids = this.getDataIds(this.dataIds);
                        this.$http.post("GenerateLog/PostBatchDelete", ids).then(
                            function (res) {
                                if (res.data.status == 1) {
                                    self.dataIds = [];
                                    self.$Notice.success({ title: '删除成功！', desc: false });
                                    self.initPageData();
                                }
                                else {
                                    self.$Modal.error({ title: "提示信息", content: "数据删除失败!!!" });
                                }
                            }
                        );
                    }
                });
            } else {
                self.$Modal.warning({ title: "提示信息", content: "请选择需要删除的数据!" });
            }

        },
        getDataIds(idList) {
            var ids = [];
            if (idList.length !== 0) {
                for (var i = 0; i < idList.length; i++) {
                    ids.push(idList[i].Id);
                }
            }
            return ids;
        }
    },
    //创建Vue页面方法
    created: function () {
        //创业Vue前调用获取this.datas: {},//table数据对象
        this.initPageData();
        this.SearchAreaList();
    },
    watch: {
        //需要监听的在此处新增监听对象
    }
}
</script>
